#include <thread>
#include <iostream>
#include <mutex>
using namespace std;

mutex mLock;
int global =0 ;
void task(){

    lock_guard<mutex> lock(mLock);
    for (size_t i = 0; i < 100000000; i++)
    {
        global++;
    }
    cout << global << endl;
    
}
int main(int argc, char const *argv[])
{
    thread t1(task);
    thread t2(task);
    thread t3(task);
    t1.join();
    t2.join();
    t3.join();
    return 0;
}
